package com.encapi.framework.wrapper.response;

import com.fasterxml.jackson.databind.ObjectMapper;
import javax.annotation.Resource;

public class JacksonResponseDataWrapper extends AbstractResponseDataWrapper<Object> {

    @Resource
    private ObjectMapper objectMapper;

    @Override
    protected String convertJson(Object needEncData) throws Exception{
        return objectMapper.writeValueAsString(needEncData);
    }

    @Override
    protected Object parseOriginData(Object originData) {
        return originData;
    }

    @Override
    protected Object wrapToEntity(Object originData, String encryptedData) {
        return encryptedData;
    }
}
